
import BasicLayout from '@/components/main/main'
import index from './modules/index'
import frameOut from './modules/frameOut'

// 主框架显示
const frameIn = [
    {
        path: '/home/',
        meta: {
            title: 'AI智能回收'
        },
        redirect: {
            name: 'home_index'
        },
        components: BasicLayout,
        children: [
            // {
            //     path: 'system/user',
            //     name: 'systemUser',
            //     meta: {
            //         auth : true,
            //         title : '个人中心'
            //     },
            //     components: () => import('@/views/user/index')
            // },
            // 刷新页面 必须保留
            {
                path: 'refresh',
                name: 'refresh',
                hidden: true,
                component: {
                    beforeRouteEnter (to, from, next) {
                        next(instance => instance.$router.replace(from.fullPath))
                    },
                    render: h => h()
                }
            },
            // 页面重定向 必须保留
            {
                path: 'redirect/:route*',
                name: 'redirect',
                hidden: true,
                component: {
                    beforeRouteEnter (to, from, next) {
                        // console.log(rom.params.route)
                        next(instance => instance.$router.replace(JSON.parse(from.params.route)))
                    },
                    render: h => h()
                }
            }
        ]
    },
    index,

];

// 框架外
const frameOuts = frameOut;

 //错误页面
 const errorPage = [
     {
         path: '/admin/403',
         name: '403',
         meta: {
             title: '403'
         },
         component: () => import('@/views/HomeView')
     }
 ]


export const frameInRoutes = frameIn;

export  default  [ ...frameIn  , ...errorPage , ...frameOuts ];
